{template '_header'}

<div class="page-header">当前位置：<span class="text-primary">平台管理</span></div>

<div class="page-content">
<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
    <input type="hidden" name="c" value="site" />
    <input type="hidden" name="a" value="entry" />
    <input type="hidden" name="m" value="mx_shop" />
    <input type="hidden" name="do" value="web" />
    <input type="hidden" name="r" value="platform" />

    <div class="page-toolbar">

        <div class="col-sm-4">
            <div class="pull-left">
                {ifp 'platform.add'}
                <a class="btn btn-primary btn-sm" href="{php echo webUrl('platform/post')}"><i class="fa fa-plus"></i> 添加平台</a>
                {/if}
            </div>
            <div class="input-group-btn">
                <button class="btn btn-default btn-sm"  type="button" data-toggle='refresh'><i class='fa fa-refresh'></i></button>
            </div>
        </div>

        <div class="col-sm-4 pull-right">

            <div class="input-group">
                <div class="input-group-select">
                    <select name='status' class='form-control  input-sm select-md' style="width:100px;"  onchange="submit();">
                        <option value="0">显示状态</option>
                        <option value="1" {if $status==1} selected  {/if}>显示</option>
                        <option value="2" {if $status==2} selected  {/if} >不显示</option>
                    </select>
                </div>
                <!--<input type="text" class="form-control input-sm"  name="keyword" value="{$_GPC['keyword']}" placeholder="请输入关键字" />-->
                <span class="input-group-btn">
                    <!--<button class="btn btn-sm btn-primary" type="submit"> 搜索</button>-->
                </span>
            </div>
        </div>
    </div>
</form>
{if count($list)>0}

<table class="table table-hover table-responsive">
    <thead class="navbar-inner" >
    <tr>
        <th style="width:25px;"></th>
        <th style='width:110px;'>平台名称</th>
        <th style='width:200px;'>logo</th>
        <th style='width:150px;'>所属公众号</th>
        <th style='width:70px;'>状态</th>
        <th style='width:70px;'>操作</th>
    </tr>
    </thead>
    <tbody>
    {loop $list $row}
    <tr>

        <td>
        </td>

        <td >
            <span>{$row['name']}</span>
        </td>

        <td >
            <img src="{php echo tomedia($row['thumb'])}" width="50" height="50"/>
        </td>

        <td >
            <span>{$row['uni']}</span>
        </td>

        <!--<td >-->
            <!--<a title="url" class="btn btn-info btn-sm" onclick="displayUrl('{php echo webUrl('platform')}');">url</a>-->
        <!--</td>-->

        <td>
            <span class='label {if $row['status']==1}label-success{else}label-default{/if}'
            {ifp 'platform.status'}
            data-toggle='ajaxSwitch'
            data-switch-value='{$row['status']}'
            data-switch-value0='0|不显示|label label-default|{php echo webUrl('platform/status',array('status'=>1,'id'=>$row['platformid']))}'
            data-switch-value1='1|显示|label label-success|{php echo webUrl('platform/status',array('status'=>0,'id'=>$row['platformid']))}'
            {/if}
            >
            {if $row['status']==1}显示{else}不显示{/if}</span>
        </td>
        <td  style="overflow:visible;">
            {ifp 'platform.edit'}
            <div class="btn-group btn-group-sm">
                {ifp 'platform.bonus'}
                <a href="{php echo webUrl('platform/manage/setting', array('id'=>$row['platformid']))}" class="btn btn-default btn-sm"><i class="fa fa-edit"></i>管理</a>
                {/if}

                {ifp 'platform.edit'}
                <a href="{php echo webUrl('platform/post', array('id'=>$row['platformid']))}" class="btn btn-default btn-sm"><i class="fa fa-edit"></i>编辑</a>
                {/if}
            </div>
            {/if}
        </td>
    </tr>
    {/loop}
    </tbody>
</table>
{$pager}

{else}
    <div class="panel panel-default">
        <div class="panel-body empty-data">未查询到相关数据</div>
    </div>
    {/if}
</div>
{template '_footer'}